Adaptive nonsingular terminal sliding mode control of robot manipulator based on contour error compensation

To achieve accurate contour tracking of robotic manipulators with system uncertainties, external disturbance and actuator faults, a cross-coupling contour adaptive nonsingular terminal sliding mode control (CCCANTSMC) is proposed. A nonsingular terminal sliding mode manifold is developed which eliminates the singularity completely. In order to avoid the demand of the prior knowledge of system uncertainties, external disturbance and actuator faults in practical applications, an adaptive tuning approach is proposed. The stability of the proposed control strategy is demonstrated by the finite-time stability theory. Then, the developed controller combines adaptive nonlinear terminal sliding mode control (ANTSMC) of joint trajectory tracking and proportion–differentiation control of end-effector contour tracking by introducing the coupling factor between multiple axes based on Jacobian. Moreover, a unified framework of cross-coupling contour compensation and reference position pre-compensation is built. Finally, numerical simulation and experimental results validate the effectiveness of the proposed control strategy.

In the past decades, with the rapid development of modern industrial technology, robotic manipulators have been widely used in machining, laser cutting, welding, and other fields 1 . The accuracy of contour error is one of the key concerns to ensure the quality of machined parts 2 . Contour error is defined as the shortest distance between the current position and the desired contour curve. However, most current control strategy of robotic manipulators focusses on optimizing the tracking performance of each joint to improve the contour machining accuracy of the end-effector [3][4][5][6] . Unfortunately, the joint tracking of high accuracy of robotic manipulators cannot effectively solve the problem of contour matching accuracy of the end-effector 6 . One of the main reasons is the lack of coordination of the robotic manipulator 7 . An integrated control strategy of cross-coupling contour error compensation based on chord error constraint, which consists of a cross-coupling controller and an improved position error compensator, was proposed by Zhang et al. 8 . Kommaneesang et al. 9 pointed that only a few researchers concentrate on solving the contouring problem in the robotic machining system, and the contouring control problem was transformed into the regulation problem by using the method of equivalent errors. Moreover, contour accuracy control was studied in many literatures [10][11][12] .
SMC is a particular and powerful class of variable structure control essentially which can dynamically adjust based on the current state of the system [13][14][15][16] . Thus, the system is forced to track a pre-determined trajectory of sliding mode states. The sliding mode manifold can be designed independent of object parameters and perturbations 17 . Aksu 18 proposed SMC based on a linear sliding mode manifold which guaranteed that the system states asymptotically converge on the equilibrium point. Inducting a nonlinear term in the linear SMC, Lafrnejani 19 proposed the terminal SMC (TSMC) to ensure global finite-time stability. Su 20 proposed an integral sliding mode manifold and its TSMC, and manifested the global finite-time convergence of both sliding mode manifold and tracking error. The above SMC provide an effective and stable control strategy for nonlinear systems, but these rely on the prior knowledge of system uncertainties [21][22][23][24] . Besides, these SMC trajectory tracking control of the robotic manipulator only ensures the tracking accuracy of each joint, but the accuracy of contour error is not guaranteed 25,26 . In addition, there exists a singularity phenomenon near the equilibrium point caused by the negative exponent of the TSMC 27,28 . The prior information of system uncertainties is difficult to obtain in practical tasks, such as random fault parameters and disturbances 29 . Considering the uncertainty and control system stability analysis methods 30  www.nature.com/scientificreports/ to solve the strong coupling contour error problem and avoid the prior information of system uncertainties, external disturbances and actuator faults. Compared to the existing cross-coupling control of robot manipulators, the primary contributions of this paper are summarized as follows: (1) Considering the strong coupling between the contour error and the joint error, the coupling factor with multiple axes based on the Jacobian matrix is proposed. Compared with the method of equivalent errors in Ref. 9 , the accuracy of joint error and contour error is guaranteed simultaneously. Furthermore, a unified framework of cross-coupling contour compensation and reference position precompensation is built. (2) Different from the singularity is generally solved by the parameters in equivalent control law, the uncertainties of the system and the function of the actuator faults are combined with a lumped function, and an adaptive tuning algorithm is adopted to compensate for the lumped uncertainties of the system. (3) Adaptive non-singular terminal sliding mode control with cross-coupled contour is improved, and the stability of the proposed control strategy is demonstrated by the finite-time stability theory. Compared with 20,31 , the tracking errors convergence quickly, and the performance of the proposed control is improved by approximately 61% and 34%, respectively.
This paper is organized as follows: the problem formulation and motivation are indicated in "Problem formulations and motivation" section, ANTSMC for the precise trajectory tracking of the robotic manipulator with dynamic uncertainties, external disturbances and actuator faults is proposed, and its stability with finite-time is discussed in "Adaptive non-singular terminal sliding mode control" section. In "Contour error compensation with cross coupling control" section, the contour error compensation based on the cross-coupling control is presented. Numerical simulation and experiment results are given in "Contour error compensation with cross coupling control" section.

Problem formulations and motivation
The dynamic of n− DOF (Degree-of-Freedom) robotic manipulator can be expressed by Newton-Euler formula as 32 where q,q,q ∈ R n×1 are the vectors of position, velocity and acceleration in joint space, respectively. M q ∈ R n×n is the positive definite inertial matrix, and B q,q ∈ R n×n is Coriolis and centripetal matrix, and G q ∈ R n×1 is the gravity matrix, and F q,q ∈ R n×1 is the vector of the friction, τ ∈ R n×1 is the vector of the input torque, and τ d ∈ R n×1 is the vector of torque with external disturbance.
For actual applications, it is difficult to obtain the precise dynamic model of the robot manipulator as the nonlinearities of the friction and the external disturbances. Hence, (1) can be rewritten as where ϕ q,q, t ∈ R n×1 is the lumped uncertainty of the system and can be defined by where M q , B q,q and G q are the uncertain parameters un-modeled for the dynamics of robot manipulator.
The properties of (2) are satisfied with

Property 1 M q is the symmetric and positive matrix, and bounded by
where m and m are positive constant parameters, respectively, and 0 < m < m . I ∈ R n×n is an identity matrix.

q is the skew symmetric matrix and satisfy with
where D is any vector.

Property 3 G q is bounded by
where G k ∈ R n×1 is positive constant matrix.
Considering the problem of actuator faults during the operating process of the robot manipulator, (2) can be rewritten as follows www.nature.com/scientificreports/ where f = γ t − T f φ q,q, τ is the function of the actuator faults, and γ t − T f ∈ R n×n is the time profile of the faults, φ q,q, τ ∈ R n×1 is the vector of the faults, and T f is the time of appearance of the faults. The time profile of the faults γ t − T f is a diagonal matrix, yields to where γ i denote the influence of the faults to the ith state. The time profile mode of the faults is given by where σ i > 0 is the evolution rate of the faults.

Adaptive non-singular terminal sliding mode control
Adaptive non-singular terminal sliding mode control. The position tracking error denoted by Non-singular terminal sliding mode manifold s is defined as where c 1 , c 2 ∈ R n×n are constant positive definite diagonal matrix, α and β are positive odd integers, and satisfy with 1 < α/β < 2 , η > 0 . e η sgn(e) = e η 1 sgn(e 1 ), · · · , e η n sgn(e n ) T . sgn( * ) is the signum function.
Derivation (11) with respect to time, we obtain The positive-definite Lyapunov function is given by Derivation (13) with respect to the time, and combining with (12), yields to Substituting (7) into (14), we obtain Simplified (15), we obtain Let V 1 = 0 , the equivalent control law τ eq is derived as Assumed that the uncertainties and actuator faults of the robot manipulator are defined as The upper bound of function K is estimated as follows where � * � is the standard Euclidean norm. The switch control law τ sw is given by where k = �K� max + υ, υ is the switch control gain, and υ ≥ 0, and 0 < µ < 1 is a positive constant. Thus, the NTSMC is derived as Since ϕ and f are the lumped uncertainty of the system and the function of the actuator faults, respectively, K is unknown function caused by ϕ and f . However, the design process of NTSMC relies on the value of function K , and hence an adaptive algorithm is proposed to determine the value of uncertainties and actuator faults.
The estimated error is defined as where K is the estimated value of K . Assumed that the uncertainties and actuator faults change slowly, there has K = 0. Derivation (22) with respect to the time, we obtain The control law τ of the system can be rewritten as follows: The positive definite Lyapunov function with estimated error is given by where ξ is positive integer. Derivation (25) with respect to the time, yields to Adaptive algorithm is given by Substituting (27) into (26), we obtain where η 1 = 1 n n i=1 |s i | , η 2 = �s� 2−µ |s| µ−1 max , and |s| max = max (|s 1 |, · · · , |s n |). The schematic of the proposed ANTSMC is shown in Fig. 1. When x 0 = 0 , the convergence time can be expressed as

Contour error compensation with cross coupling control
Contour error of end-effector of robot manipulator. The trajectory planning interpolation method can be used to fit the trajectory contour into a straight line or a circular contour. The contour error model of the straight-line contour for an XY planar is shown in Fig. 2.
In   www.nature.com/scientificreports/ P is the actual position of the end-effector of robotic manipulator, P d is the reference point, ε is the contour error, e x and e y are the error components along with x and y axis of the tracking error e , respectively. θ is the angle between the reference trajectory y and the x axis.
Assumed that the contour error is the shortest distance between the prevailing position and the desired contour curve. The contour error of plane line is defined as where c x = − sin θ , c y = cos θ are the cross coupling operator.

ANTSMC based on cross coupling. The contour motion control with cross coupling is given by
where K p is the proportional gain, and K d is the differential gain of the contour motion control.
As compensation of contour and trajectory tracking control are carried out in the task space and in the joint space, respectively, so the mapping relationship between two space is established as follows where e c is the vector of contour tracking error in the task space, and e q is the vector of trajectory tracking error in the joint space, J q is the Jacobian matrix.
According to (42), the contour tracking error is derived, yields to The rectifier gain of contour tracking error compensation is given by Combining (21) with (41), we obtain where C n ∈ R n×1 is the contour error compensation rectifier gain.
Remark From Eq. (45), one can see that the proposed CCCANTSMC is a combination of ANTSMC control for joint trajectory tracking and PD contour control for end-effector. The ANTSMC in joint space ensures the stability of the robotic system, while the PD control in the workspace is used to reduce contour errors. The goal of the proposed cross-coupled controller is to improve the tracking performance of the joint and further improve the contour tracking performance of the end-effector.
The schematic of the ANTSMC with cross-coupling is shown in Fig. 3.

Experiments
Robotic manipulator with two-link is used to illustrate the effectiveness of the proposed control strategy, shown as Fig. 4. Assumed that the mass of each link is concentrated. The dynamic equation of the robotic manipulator with two-link is derived as follows e c = J q e q , (43) ε = c x c y e c = c x c y J q e q .
(44) C n = c x c y J q T .
φ q,q, τ = 30 sin q 1 q 2 + 4 cos q 1 q 2 + 15 cos q 1q2 T f 1 ≥ 1.5 0 T f 2 ≥ 1.5 .   Table 1, respectively. The experiment platform is built, shown as Fig. 5. Trajectory tracking of joint 1# and 2# in the joint space is shown in Fig. 6. The error of trajectory tracking in the joint space are shown in Fig. 7. The contour tracking of the end-effector of the robotic manipulator is shown in Fig. 8.
The mean square value of the tracking error is defined as . Table 1. Parameters of controller.

Type of controller Parameters
Traditional PID    www.nature.com/scientificreports/ Moreover, there are the actuator faults after 1.5 s, the control performance of PID controller decreases remarkably, and the control performance of NTSMC converges after a slight fluctuation. However, the NTSMC used adaptive algorithm can ensure the stability of the system effectively. In addition, from Fig. 8, it is obvious to see that compared with PID, NTSMC and ANTSMC, the proposed CCCANTSMC can quickly optimize the contour error when there are significant position errors in the system. Table 2 shows that the mean squared contour error for PID, NTSMC and ANTSMC is 0.0076 m, 0.0051 m and 0.0044 m, respectively, while the mean squared contour error for CCCANTSMC is 0.0029 m. Compared to PID, NTSMC, and ANTSMC, the control performance of CCCANTSMC is improved by approximately 61%, 43%, and 34%, respectively. The proposed CCCANTSMC significantly reduces the contour error and the systematic tracking error. Moreover, the mean squared tracking error of each joint of CCCANTSMC is smaller than that of PID, NTSMC and ANTSMC. The experimental results demonstrate that the proposed control strategy has better properties than the remaining three control methods in contour control.
In this paper, due to sudden changes in position, velocity and acceleration at the junction inflection point of adjacent straight segments, each controller will suffer performance degradation to a certain extent at the time of 1 s and 2 s, but the adaptive tunning method of the proposed control strategy for this kind of mutation is better than the traditional PID, NTSMC and ANTSMC. However, it is necessary to perform trajectory planning processing at these sudden changes to optimize the controller performance, which will be a desired future research work.

Conclusions
In this paper, a cross-coupling contour adaptive nonsingular terminal sliding mode control (CCCANTSMC) is proposed for the issue of precise contour tracking of the robotic manipulator in the presence of system uncertainties, external disturbance, and actuator faults. Based on the strengths of the NTSMC for driving the system state to the equilibrium point in finite time, the adaptive tuning approach is proposed. Thus, the prior knowledge of system uncertainties, external disturbance, and actuator faults is avoided and the singularity problem is eliminated. Introducing coupling factors among the multi-axes based on Jacobian, ANTSMC of joint tracking and PD control of end-effector contour tracking is combined to improve the accuracy of contour error. Furthermore, a unified framework of cross-coupling contour compensation and reference position pre-compensation is built. The experimental results are shown to prove the effectiveness of the proposed control strategy.

Data availability
The datasets used and/or analysed during the current study available from the corresponding author on reasonable request.